package be.kuleuven.cs.mop.domain.exceptions;


import be.kuleuven.cs.mop.domain.model.Task;
import be.kuleuven.cs.mop.domain.model.impl.TaskImpl;



public class BusinessRuleTwoViolationExceptionTask extends BusinessRuleViolationException {
	private static final long serialVersionUID = 1L;
	
	public static final String DEFAULT_MESSAGE = "When a task depends on a task with a Failed status, it should have a Failed status itself. When a task depends on a task with an Unfinished status, it should not be successful or available.";
	
	private final TaskImpl task;
	
	public BusinessRuleTwoViolationExceptionTask(final String msg, TaskImpl task) {
		super(msg);
		if(task == null)
			throw new NullPointerException("Task = NULL");
		this.task = task;
	}
	
	public BusinessRuleTwoViolationExceptionTask(TaskImpl task) {
		this(DEFAULT_MESSAGE, task);
	}
	
	public Task getTask() {return task;}
}